//
//  NewsView.m
//  NewsScrollDemo
//
//  Created by cfq on 16/7/4.
//  Copyright © 2016年 lczy. All rights reserved.
//

#import "NewsView.h"

@implementation NewsView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        //[self setBackgroundColor:[UIColor grayColor]];
        _titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 2, self.frame.size.width, self.frame.size.height)];
        _titleLabel.textColor=[UIColor whiteColor];
        _titleLabel.backgroundColor=[UIColor clearColor];
        _titleLabel.font=[UIFont boldSystemFontOfSize:13.0];
        //        titleLabel.lineBreakMode = UILineBreakModeWordWrap;
        _titleLabel.lineBreakMode = UILineBreakModeTailTruncation;
        _titleLabel.numberOfLines = 1;
        [self addSubview:_titleLabel];
        _descriptionLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 17, 260, 15)];
        _descriptionLabel.textColor=[UIColor blackColor];
        _descriptionLabel.backgroundColor=[UIColor clearColor];
        _descriptionLabel.font=[UIFont systemFontOfSize:11.0];
        _descriptionLabel.lineBreakMode = UILineBreakModeWordWrap;
        _descriptionLabel.numberOfLines = 1;
        [self addSubview:_descriptionLabel];
        _newsButton=[UIButton buttonWithType:UIButtonTypeCustom];
        [_newsButton setFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [self addSubview:_newsButton];
    }
    return self;
}
-(void)setViewWithTitle:(NSString *)title description:(NSString *)description{
    [_titleLabel setText:title];
    _titleLabel.text = title;
    [_descriptionLabel setText:description];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
